package hyy_2022;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 重复的子字符串: 非空字符串s,检查是否可以通过它的一个子串重复多次构成
 * abab -- true
 * aba -- false
 * abcabcabc -- true
 */
public class _0829_459_RepeatedSubstring {

    public boolean repeatedSubStringPattern(String s) {
        String str = s + s;
        return str.substring(1,str.length()-1).contains(s);
    }

    public static void main(String[] args) {
        List<String> strs = new ArrayList<>();
        String SCIENTIFIC="^([\\+|-]?\\d+(.{0}|.\\d+))[Ee]{1}([\\+|-]?\\d+)$";
        Pattern compile = Pattern.compile(SCIENTIFIC);
        Matcher matcher = compile.matcher("1.23E4");
        if (matcher.matches()){
            strs.add(matcher.group());
        }
        System.out.println(strs);
    }
}
